from typing import *

class Solution:
    def checkArray(self, nums: List[int], k: int) -> bool:
        f = [0] * len(nums)
        v = 0
        for i,num in enumerate(nums):
            if num + v < 0: return False
            if num + v > 0:
                if i + k - 1 < len(nums): f[i + k - 1] = num + v
                else:
                    return False
                v = -num
            v += f[i]
        return True